package com.wonder.app.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wonder.app.domain.SfcOptrptDetail;
import com.wonder.app.domain.Tray;


import java.util.List;
import java.util.Map;

public interface TrayService extends IService<Tray> {


    /**
     * 验证托盘信息
     *
     * @param tray
     * @param type
     * @return
     */
    String validate(Tray tray, String type);

    /**
     * 创建托盘信息
     *
     * @param map
     * @return
     */
    boolean createTray(Map<String, Object> map);

    /**
     * 获取托盘信息
     *
     * @param map
     * @return
     * @throws Exception
     */
    Map<String, Object> getTray(Map<String, Object> map) throws Exception;

    /**
     * 领料扣减
     *
     * @param map
     * @return
     * @throws Exception
     */
    boolean updateTray(Map<String, Object> map) throws Exception;


    boolean addTray(Map<String, Object> map, String type) throws Exception;

    Map<String, Object> getTrayList(Map<String, Object> map);

    boolean updatetrayCount(Map<String, Object> map) throws Exception;

    String createTrayPda(Map<String, Object> map, String userName) throws Exception;

    String createTrayPdaByFeed(Map<String, Object> map, String userName) throws Exception;

    Boolean bandingOperp(Map<String, Object> trayData, String operpNo,String moBillNo)throws Exception;

    Map<String, Object> getTrayPlan(Map<String, Object> map)throws Exception;

    Boolean bandingProcess(Map<String, Object> trayData, Map<String, Object> operpData, Double count)throws Exception;

    Boolean bandingProcessPackage(Map<String, Object> trayData, Map<String, Object> operpData, SfcOptrptDetail detail ,String ERPBIllNo)throws Exception;

    void updateTrayLocation(String trayno, String trayStockNo, String trayLocationNo,String instockTime);

    Map<String, Object> getTrayTransfer(Long userId, Map<String, Object> map) throws Exception;

    boolean updatetrayCountByPda(Map<String, Object> map)throws Exception;

    Map<String, Object> getTrayAllocation(Map<String, Object> map)throws Exception;

    String createTrayPdaByKu(Map<String, Object> map, String userName)throws Exception;
}